package com.example.administrator.yunniuusedcar.holder;

import android.content.Context;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.administrator.common.ui.BaseAdapterRV;
import com.example.administrator.common.ui.BaseHolderRV;
import com.example.administrator.yunniuusedcar.MainActivity;
import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.activity.CommodityDetailsActivity;
import com.example.administrator.yunniuusedcar.activity.DetailsCarActivity;
import com.example.administrator.yunniuusedcar.adapter.HomeRanCarAdapter;
import com.example.administrator.yunniuusedcar.model.mode_benn.Home;
import com.example.administrator.yunniuusedcar.model.mode_benn.HomeRanCarListBean;
import com.squareup.picasso.Picasso;

import java.util.List;

/**
 * Created by Administrator on 2017/12/15.
 * 随机汽车
 */

public class Home03foolHolder extends BaseHolderRV<HomeRanCarListBean> {    /// HomeRanCarListBean

    private RecyclerView recyclerView03;
    private HomeRanCarAdapter homeRanCarAdapter;


    /**
     * 构造方法
     *
     * @param context     上下文对象
     * @param parent      指RecyclerView控件
     * @param adapter     适配器
     *., @param layoutResId RecyclerView的一个item布局文件
     */
    public Home03foolHolder(Context context, ViewGroup parent, BaseAdapterRV<HomeRanCarListBean> adapter) {
        super(context, parent, adapter, R.layout.item_recycleview2); //DaRongQI  //item_home_fool:   NeiRONG
    }
    @Override
    public void onFindViews(View itemView) {   //找
        recyclerView03 = (RecyclerView) itemView.findViewById(R.id.recycler_view6);

    }

    @Override
    protected void onRefreshView(HomeRanCarListBean bean1, int position) {
        bean = (HomeRanCarListBean)bean1;

        List<HomeRanCarListBean.Data> data = bean.data;

        recyclerView03.setLayoutManager(new LinearLayoutManager
                (context, LinearLayoutManager.VERTICAL, false));   //vertical
        //适配器
        homeRanCarAdapter = new HomeRanCarAdapter(context, data);
        recyclerView03.setAdapter(homeRanCarAdapter);
              //  return list ;
    }
}

